#!/usr/bin/env perl
#
# Convert input, such as:
#
# Fri Oct 17 05:44:47 2008
#  - caching geo locations
#  - added iphone support
#
# -to-
# <p>
#  <b>Fri Oct 17 05:44:47 2008</b><br/>
#   <ul>
#    <li>caching geo locations</li>
#    <li>added iphone support</li>
#   </ul>
# </p>

my $have_printed_date = 0;
print "<?php\n";
print "define('BASE','../');\n";
print "define('TITLE', 'Changes');\n";
print "define('SMALL_CONTENT',TRUE);\n";
print "include BASE . 'menu_head.php';\n";
print "?>\n";
while (<>) {
    chomp;
    if (m/\w{3} \w{3}\s+\d+\s+\d{2}:\d{2}:\d{2} \d{4}/) {
        if ($have_printed_date) {
            print "  </ul>\n";
            print "</p>\n";
        }
        print "<p>\n";
        print " <b>$_</b><br/>";
        print "  </ul>";
        print "\n";
        $have_printed_date = 1
    } elsif (m/\s*-\s*(.*)/) {
        print "   <li>";
        print $1;
        print "</li>\n";
    }
  }
if ($have_printed_date) {
    print "  </ul>\n";
    print "</p>\n";
}
print "<?php\n";
print "include BASE . 'menu_foot.php';\n";
print "?>\n";
